package com.hs.eric.util;

import org.springframework.core.io.support.PropertiesLoaderUtils;

import java.io.IOException;
import java.util.Properties;

/**
 * Description:
 * User: eric
 * Date: 2015/4/11
 * Time: 10:33
 */
public class PropertiesUtil {

    public static String getValue(String file, String key) {
        Properties properties = null;
        try {
            properties = PropertiesLoaderUtils.loadAllProperties(file);
        } catch (IOException e) {
            e.printStackTrace();
        }
        if (null != properties) {
            return properties.getProperty(key);
        }
        return null;
    }
}
